<?php
require_once 'BaseController.php';

/**
 * 【SP版】通勤通学時間から探す コントローラ
 */
class Mobileapi_SearchController extends Mobileapi_BaseController
{

    /**
     * メインアクション
     */
    public function indexAction()
    {
        $params = $this->getParameters();

        $method = $params['Method'];

        $this->displayBody2($method);
    }

    /**
     * メインアクション(post)
     */
    public function postAction()
    {
        $params = $this->getParameters();

        $method = $params['Method'];

        if ($method == 'tsukintsugakujikansearch')
        {

            if ($params['NextHope'] == '1')
            {

                print_r($params);
                $this->displayBody2($method . '_hope');
            }
            else
            {

                $a = new Mobileapi_Model_Search();

                // $data = $a->getTsukinTakingTimeEkiData($params);
                $data = $a->getTsukinTakingTimeTargetStation($params);

                foreach ($params as $key => $value)
                {
                    $this->_data[$key] = $value;
                }
                $this->_data['Ekidata'] = $data;

                $this->displayBody2($method . '_select');
            }
        }

        else
            $this->displayBody2($method);
    }

}
?>